<template>
  <div class="remarks-style">
    <div
      class="remarks-style-conetnt"
      :style="{ backgroundImage: `url(${publicUrls + 'free/style2/scrollBcakground2.webp'})` }"
    >
      <div class="remarks-style-left">
        <div class="title-box"> 
          <div class="title">
            <p>{{ store.childTitle }}</p>
            <p v-if="store.childSubTitle">——{{ store.childSubTitle }}</p>
          </div>
          <div class="close-box" @click="store.setChildRemarksShow(false)">
            <i class="doorIcon">&#xe63d;</i>
          </div>
        </div>
        <scrollBox
          color="rgba(33, 35, 38, 0.6)"
          v-if="Scrollheights"
          :remarks="store.childRemarks"
          :byid="100"
          :height="getScrollWComputed"
        >
          <template #solidBorder>
            <div class="solidBorder-child"></div>
          </template>
        </scrollBox>
      </div>
    </div>
    <div class="remarks-style--border"></div>
  </div>
</template> 

<script lang="ts">
export default defineComponent({
  name: 'styleTwo',
});
</script>

<script setup lang="ts">
import { publicUrls } from '@/utils/minxin';
import scrollBox from '../scrollBox.vue';
import { useProjectStore } from '@/store';
import { ref, computed, defineComponent } from 'vue';
import { urls } from '@/utils/request/upload';

const store = useProjectStore();
let viewportHeight = window.innerHeight;
const Scrollheights = ref();
Scrollheights.value = (viewportHeight / 900) * 388;
const getScrollWComputed = computed(() => {
  if (store.isMobileType) {
    let rootNode = document.documentElement;

    // 获取计算后的样式
    let computedStyle = window.getComputedStyle(rootNode);

    // 读取字体大小（注意这里返回的可能是一个包含单位的字符串，如"16px"）
    let fontSize = computedStyle.fontSize;

    // 如果你需要一个数字值（不带单位）进行计算，你可能需要解析这个字符串
    // 例如，使用正则表达式或split()方法去除单位，并将结果转换为数字
    let fontSizeNumber = parseFloat(fontSize.replace(/[^0-9.-]/g, ''));
    // let heights = (fontSizeNumber / 144)
    let heights = (fontSizeNumber / 144) * 388;
    return heights;
  } else {
    return Scrollheights.value;
  }
});
</script>   

<style scoped lang="less">
.remarks-style {
  display: flex;
  flex-direction: column;
  position: relative;
  width: 100%;
  max-width: 1200px;
  height: 624px;
  background: transparent;

  transform: translateZ(0px);
}
.remarks-style-conetnt {
  display: flex;
  width: 100%;
  height: 100%;
  //   background: #fff;
  background-repeat: repeat;
  background-size: 100% 100%;
  padding-top: 60px;
}
.title-box {
  width: calc(100% - 35px);
  display: flex;
  justify-content: space-between;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(33, 35, 38, 0.6);
  margin-bottom: 23px;
  .title {
    ::v-deep p {
      color: #212326;
      &:nth-child(1) {
        font-family: SourceHanSerifCN-Bold;
        font-size: 28px;
        line-height: 42px;
      }
      &:nth-child(2) {
        font-family: SourceHanSerifCN;
        font-size: 18px;
        line-height: 28px;
        opacity: 0.8;
        margin-top: 16px;
      }
    }
  }
  .close-box {
    cursor: pointer;
    height: 32px;
    z-index: 30;
    .doorIcon {
      font-size: clamp(18px, calc(32 / 1440 * 100vw), 32px);
      color: #000;
      opacity: 0.6;
    }
  }
}
.remarks-style-left {
  display: flex;
  flex-direction: column;
  align-items: start;
  flex: 1;
  padding-left: 80px;
  padding-right: 62px;
  height: 100%;
}
.solidBorder-child {
  width: 2px;
  height: 100%;
  background: #5b8c87;
  border-radius: 1px;
  opacity: 0.4;
}
::v-deep .scrollBar {
  width: 4px;
  height: 100%;
  background: #ffdc76;
  box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.15);
  border-radius: 2px;
}
::v-deep .templatestyle1-scroll-box-tumb {
  align-items: center;
  justify-content: center;
}
::v-deep {
  .solid-box-parent {
    width: 32px;
  }
  .unit-exbi-remarks-info-remarks {
    width: calc(100% - 32px);
  }
}
</style>
